import request from '@/utils/request'

import { baseUrlConfig,baseUrl } from "@/config/config";
const basePath = baseUrlConfig.businessBaseUrl;

//获取分页列表
export const examineInfoPageList = (data: any) => {
    console.log(data.safetyInspe.rectificationStatus);
    return request({
        url: baseUrl + '/safetyInspe/findPage',
        method: 'post',
        data
    })
}

// 获取外部单位数据
export const securityUnitList = () => {
    return request({
        url: baseUrl + '/department/findAll',
        method: 'get'
    })
}

// 新增
export const addExamineInfo = (safetyInspe: any) => request({
    url: baseUrl + '/safetyInspe/add',
    method: 'post',
    data:safetyInspe
})
//编辑
export const insertExamineInfo = (safetyInspe: any) => request({
    url: baseUrl + '/safetyInspe/put',
    method: 'put',
    data:safetyInspe
})
//文件与表绑定关系
export const bind = (data: any) => request({
    url: baseUrl + '/file/binding',
    method: 'put',
    data
})
// 删除
export const del = (data: any) => {
    return request({
        url:  baseUrl+ '/safetyInspe/del',
        method: 'delete',
        data
    })
}

//导出当前页的数据
export const exportPageList: (data: any) => Promise<[]> = (data: any) => {
    return request({
        url: basePath + '/secure/secureityCheck/export',
        method: 'post',
        responseType: 'blob',
        data
    })
}
